Crate deunicode

source ·
Expand description

The deunicode library transliterates Unicode strings such as “Æneid” into pure ASCII ones such as “AEneid.”

Supports no-std. Stores Unicode data in a compact format.

It started as a Rust port of Text::Unidecode Perl module, and was extended to support emoji.

See README for more info.

§Examples

use deunicode::deunicode;

assert_eq!(deunicode("Æneid"), "AEneid");
assert_eq!(deunicode("étude"), "etude");
assert_eq!(deunicode("北亰"), "Bei Jing");
assert_eq!(deunicode("ᔕᓇᓇ"), "shanana");
assert_eq!(deunicode("げんまい茶"), "genmaiCha");
assert_eq!(deunicode("🦄☣"), "unicorn biohazard");
assert_eq!(deunicode("…"), "...");

// format without a temporary string
use deunicode::AsciiChars;
format!("what's up {}", "🐶".ascii_chars());

Structs§

  • Iterator that translates Unicode characters to ASCII strings.

Traits§

  • Convenience functions for deunicode. use deunicode::AsciiChars

Functions§